//
//  HWLocallyStoredData.m
//  HWanGame
//
//  Created by 陈道斌 on 2019/11/4.
//  Copyright © 2019 Chendaobin. All rights reserved.
//

#import "HWLocallyStoredData.h"

@implementation HWLocallyStoredData

// 取出登录UserID
+ (NSString *)getLoginUserID {
    
    if (nil != [[NSUserDefaults standardUserDefaults] objectForKey:@"uid"]) {
           return [[NSUserDefaults standardUserDefaults] objectForKey:@"uid"];
       }else{
           return @"";
       }
    
    
}


// 设置UIserID
+ (void)setUserID:(NSString *)userID {
    
      NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
      [defaults setObject:userID forKey:@"uid"];
      [defaults synchronize];

}



// 取出用户名
+ (NSString *)getUsername {
    
    if (nil != [[NSUserDefaults standardUserDefaults] objectForKey:@"username"]) {
              return [[NSUserDefaults standardUserDefaults] objectForKey:@"username"];
    
    }else{
              return @"";
   }
    
}




// 设置用户名
+ (void)setUsername:(NSString *)username {
    
     NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
        [defaults setObject:username forKey:@"username"];
        [defaults synchronize];
    
    
}



// 头像地址
+ (NSString *)getHead {
    
    if (nil != [[NSUserDefaults standardUserDefaults] objectForKey:@"head"]) {
             
        return [[NSUserDefaults standardUserDefaults] objectForKey:@"head"];
       
       }else{
                 return @"";
    }
    
}

// 头像地址
+ (void)setHead:(NSString *)head {
    
    NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
    [defaults setObject:head forKey:@"head"];
    [defaults synchronize];

    
}




// 存储选择 tabar 显示几个
+ (NSString *)getAppStr {
    
    
    if (nil != [[NSUserDefaults standardUserDefaults] objectForKey:@"appStr"]) {
             
        return [[NSUserDefaults standardUserDefaults] objectForKey:@"appStr"];
       
       }else{
            return @"";
    }
    
    
    
}





// 存储  tabar 显示几个

+ (void)setAppStr:(NSString *)appStr {
    
     NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
     [defaults setObject:appStr forKey:@"appStr"];
     [defaults synchronize];
    
}






+ (NSString *)getAccount {
    
    if (nil != [[NSUserDefaults standardUserDefaults] objectForKey:@"account"]) {
            
        return [[NSUserDefaults standardUserDefaults] objectForKey:@"account"];
         
    }else{
             return @"";
    }
      
    
    
}

+ (void)setAccount:(NSString *)account {
    
      NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
      [defaults setObject:account forKey:@"account"];
      [defaults synchronize];

    
}

@end
